/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/


#if !defined(AFX_PGLMARKUP_H__3BB8B027_BBD6_4DCF_ACDE_7F1922437BEB__INCLUDED_)
#define AFX_PGLMARKUP_H__3BB8B027_BBD6_4DCF_ACDE_7F1922437BEB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <pgl/markup/MarkupDllInclude.h>
#include <pgl/markup/STLXMLParser.h>

//include lib


//#ifdef _MARKUP_NO_MARKUP
//	#include <pgl/markup/Markup_empty.h>
//#else
//	#ifdef _MARKUP_USE_MARKUP_LITE
//		#include <pgl/markup/Markup_lite.h>
//	#else
//		#include <pgl/markup/Markup.h>
//	#endif
//#endif

#include <pgl/markup/Markup.h>

namespace markup
{

/*! \brief Class wrapper for CMarkup adding useful features.

\ingroup XMLParserGroup

This class mimics the well-known CArchive class and implements a few useful helpers:
<ul>
<li>File handling with Open and Close functions (zipping using zlib)
<li>Classic IsStoring() function.
<li>Added Namespace Support
<li>Helpers to write and read bool, int, float, double, UINT, DWORD, STL vectors
<li>FindChildElemAttrib( LPCTSTR szName , LPCTSTR szAttrib, LPCTSTR szAttribValue )
Finds a child elem with tag szName and an attribute szAttrib of value szAttribValue
<li>Helper functions FindGetElem, FindGetChildElem : Search for tag, if found loads corresponding value.
</ul>

*/
class MARKUP_EXT_CLASS CMarkupArchive : public CMarkup  
{
public:

	//! Archive flags	
	static enum EArchiveMode
	{	
		//! Loads and stores zipped information
		ArchiveModeZipped =		0x0001,
	};

	//! \name Constructors
	//@{
	/*! Default constructor

  \param dwMode the archive mode. Can be a combination (with |) of the EArchiveMode Enum. Default is ArchiveModeStoring
	*/
	CMarkupArchive(DWORD dwMode = 0): CMarkup() {	m_dwMode = dwMode; m_strEncodingString = _T("ISO-8859-1");};
	virtual ~CMarkupArchive();
	//@}

	//! \name File Handling
	//@{
	/*! Load a file

	\param szFileName the xml file name
	\param bStoring true if storing xml to a file, false if loading
	*/
	bool LoadFile(LPCTSTR szFileName);

	/*! Load a xml string

	\param szXMLString the xml string
	\return true if success, false otherwize
	*/
	bool LoadString(LPCTSTR szXMLString);

	//! Close the file
	bool SaveFile(LPCTSTR szFileName);
	
	/*! Sets the xml encoding string.

	When the xml is stored, a first line is appended to the file:
	<pre>
	<?xml version="1.0" encoding="'Here the encoding string'" ?>
	</pre>

	The default value is ISO-8859-1.
	*/
	void SetEncodingString(LPCTSTR lpszEncodingString) { if (lpszEncodingString != NULL)	{	m_strEncodingString = lpszEncodingString;}};
	//! returns the encoding string
	LPCTSTR GetEncodingString() const														{	return m_strEncodingString;};

	//@}

	//! \name Flags
	//@{
	//! Returns true if zipping
	bool IsZipping() const				{	return m_dwMode & ArchiveModeZipped;};
	void SetZipping( bool bEnable); 
	
	/*! Sets the archive mode.

	\param _dwMode a combination of the members of EArchiveMode
	*/
	void SetModeFlag( DWORD _dwMode) {	m_dwMode = _dwMode;};
	//@}

	//! \name Namespace
	//@{
	/*! Sets the xml namespace

	\param szNameSpace the namespace

	The namespace, if non null, is appended to every xml entry: <a>...</a> becomes <namespace:a>...</namespace:a>
	*/
	bool SetNameSpace(LPCTSTR szNameSpace);
	//! Return the namespace
	CString GetNameSpace() const;
	//@}

	//! \name Specialized getters
	//@{
	bool GetDataBool() const;	
	int GetDataInt() const;
	UINT GetDataUINT() const;
	DWORD GetDataDWORD() const;
	float GetDataFloat() const;
	double GetDataDouble() const;
	COleDateTime GetDataDateTime() const;
	COleDateTimeSpan GetDataDateTimeSpan() const;
	void GetDataEx(std::vector<double>& _v) const;
	void GetDataEx(std::vector<float>& _v) const;
	void GetDataEx(std::vector<int>& _v) const;
	void GetDataEx(std::vector<BYTE>& _v) const	;
	void GetDataEx(std::vector<short>& _v) const;
	void GetDataEx(std::vector<long>& _v) const;
	void GetDataEx(std::valarray<double>& _v) const;
	void GetDataEx(std::valarray<float>& _v) const;
	void GetDataEx(std::valarray<int>& _v) const;
	void GetDataEx(std::valarray<BYTE>& _v) const;
	void GetDataEx(std::valarray<short>& _v) const;
	void GetDataEx(std::valarray<long>& _v) const;
	void GetDataEx(std::list<UINT>& _l) const;
	void GetDataEx(std::list<double>& _l) const;
	void GetDataEx(std::list<float>& _l) const;
	void GetDataEx(std::list<int>& _l) const;
	void GetDataEx(std::list<BYTE>& _l) const;

	bool GetChildDataBool() const;
	int GetChildDataInt() const	;
	long GetChildDataLong() const;
	UINT GetChildDataUINT() const;
	DWORD GetChildDataDWORD() const	;
	float GetChildDataFloat() const	;
	double GetChildDataDouble() const;
	COleDateTime GetChildDataDateTime() const;
	COleDateTimeSpan GetChildDataDateTimeSpan() const;
	void GetChildDataEx(std::vector<double>& _v) const;
	void GetChildDataEx(std::vector<float>& _v) const;
	void GetChildDataEx(std::vector<int>& _v) const	;
	void GetChildDataEx(std::vector<BYTE>& _v) const;
	void GetChildDataEx(std::vector<short>& _v) const;
	void GetChildDataEx(std::vector<long>& _v) const;
	void GetChildDataEx(std::valarray<double>& _v) const;
	void GetChildDataEx(std::valarray<float>& _v) const	;
	void GetChildDataEx(std::valarray<int>& _v) const;
	void GetChildDataEx(std::valarray<BYTE>& _v) const	;
	void GetChildDataEx(std::valarray<short>& _v) const	;
	void GetChildDataEx(std::valarray<long>& _v) const	;
	void GetChildDataEx(std::list<UINT>& _l) const	;
	void GetChildDataEx(std::list<double>& _l) const;
	void GetChildDataEx(std::list<float>& _l) const	;
	void GetChildDataEx(std::list<int>& _v) const	;
	void GetChildDataEx(std::list<BYTE>& _v) const;

	bool GetAttribBool(LPCTSTR szAttrib ) const;
	int GetAttribInt(LPCTSTR szAttrib ) const;
	UINT GetAttribUINT(LPCTSTR szAttrib ) const	;
	DWORD GetAttribDWORD(LPCTSTR szAttrib ) const;
	float GetAttribFloat(LPCTSTR szAttrib ) const;
	double GetAttribDouble(LPCTSTR szAttrib ) const;
	COleDateTime GetAttribDateTime(LPCTSTR szAttrib ) const;
	void GetAttribEx(LPCTSTR szAttrib, std::vector<double>& _v) const;
	void GetAttribEx(LPCTSTR szAttrib, std::vector<float>& _v) const;
	void GetAttribEx(LPCTSTR szAttrib, std::vector<int>& _v) const;
	void GetAttribEx(LPCTSTR szAttrib, std::vector<BYTE>& _v) const;
	void GetAttribEx(LPCTSTR szAttrib, std::vector<short>& _v) const;
	void GetAttribEx(LPCTSTR szAttrib, std::vector<long>& _v) const;
	void GetAttribEx(LPCTSTR szAttrib, std::valarray<double>& _l) const;
	void GetAttribEx(LPCTSTR szAttrib, std::valarray<float>& _l) const;
	void GetAttribEx(LPCTSTR szAttrib, std::valarray<int>& _l) const;
	void GetAttribEx(LPCTSTR szAttrib, std::valarray<BYTE>& _l) const;
	void GetAttribEx(LPCTSTR szAttrib, std::list<double>& _l) const;
	void GetAttribEx(LPCTSTR szAttrib, std::list<float>& _l) const;
	void GetAttribEx(LPCTSTR szAttrib, std::list<int>& _l) const;
	void GetAttribEx(LPCTSTR szAttrib, std::list<BYTE>& _l) const;

	bool GetChildAttribBool(LPCTSTR szAttrib ) const;
	int GetChildAttribInt(LPCTSTR szAttrib ) const;
	UINT GetChildAttribUINT(LPCTSTR szAttrib ) const;
	DWORD GetChildAttribDWORD(LPCTSTR szAttrib ) const;
	float GetChildAttribFloat(LPCTSTR szAttrib ) const;
	double GetChildAttribDouble(LPCTSTR szAttrib ) const;
	COleDateTime GetChildAttribDateTime(LPCTSTR szAttrib ) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::vector<double>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::vector<float>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::vector<int>& _v) const	;
	void GetChildAttribEx(LPCTSTR szAttrib, std::vector<BYTE>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::vector<short>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::vector<long>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::valarray<double>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::valarray<float>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::valarray<int>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::valarray<BYTE>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::valarray<short>& _v) const	;
	void GetChildAttribEx(LPCTSTR szAttrib, std::valarray<long>& _v) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::list<double>& _l) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::list<float>& _l) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::list<int>& _l) const;
	void GetChildAttribEx(LPCTSTR szAttrib, std::list<BYTE>& _l) const;
	//@}

	//! \name Specialized Adders
	//@{
	bool AddElemEx(LPCTSTR szName, const CString &str);
	bool AddElemEx(LPCTSTR szName, LPCTSTR szString = _T(""));
	bool AddElemEx(LPCTSTR szName, bool _bool )	;
	bool AddElemEx(LPCTSTR szName, int _int );
	bool AddElemEx(LPCTSTR szName, UINT _UINT );
	bool AddElemEx(LPCTSTR szName, DWORD _DWORD );
	bool AddElemEx(LPCTSTR szName, long _long );
	bool AddElemEx(LPCTSTR szName, float _float );
	bool AddElemEx(LPCTSTR szName, double _double );
	bool AddElemEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat = _T("%m/%d/%Y %H:%M:%S"));
	bool AddElemEx(LPCTSTR szName, const COleDateTimeSpan& _ts);
	bool AddElemEx(LPCTSTR szName, const std::vector<double>& _v );
	bool AddElemEx(LPCTSTR szName, const std::vector<float>& _v );
	bool AddElemEx(LPCTSTR szName, const std::vector<int>& _v );
	bool AddElemEx(LPCTSTR szName, const std::vector<BYTE>& _v );
	bool AddElemEx(LPCTSTR szName, const std::vector<short>& _v );
	bool AddElemEx(LPCTSTR szName, const std::vector<long>& _v );
	bool AddElemEx(LPCTSTR szName, const std::valarray<double>& _v );
	bool AddElemEx(LPCTSTR szName, const std::valarray<float>& _v );
	bool AddElemEx(LPCTSTR szName, const std::valarray<int>& _v );
	bool AddElemEx(LPCTSTR szName, const std::valarray<BYTE>& _v );
	bool AddElemEx(LPCTSTR szName, const std::valarray<short>& _v )	;
	bool AddElemEx(LPCTSTR szName, const std::valarray<long>& _v );
	bool AddElemEx(LPCTSTR szName, const std::list<UINT>& _l );
	bool AddElemEx(LPCTSTR szName, const std::list<double>& _l );
	bool AddElemEx(LPCTSTR szName, const std::list<float>& _l );
	bool AddElemEx(LPCTSTR szName, const std::list<int>& _l );
	bool AddElemEx(LPCTSTR szName, const std::list<BYTE>& _l );

	bool AddChildElemEx(LPCTSTR szName, const CString &str)	;
	bool AddChildElemEx(LPCTSTR szName, LPCTSTR szString = _T(""));
	bool AddChildElemEx(LPCTSTR szName, bool _bool );
	bool AddChildElemEx(LPCTSTR szName, int _int );
	bool AddChildElemEx(LPCTSTR szName, UINT _UINT );
	bool AddChildElemEx(LPCTSTR szName, DWORD _DWORD );
	bool AddChildElemEx(LPCTSTR szName, long _long );
	bool AddChildElemEx(LPCTSTR szName, float _float );
	bool AddChildElemEx(LPCTSTR szName, double _double );
	bool AddChildElemEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat = _T("%m/%d/%Y %H:%M:%S"));
	bool AddChildElemEx(LPCTSTR szName, const COleDateTimeSpan& _ts);
	bool AddChildElemEx(LPCTSTR szName, const std::vector<double>& _v);
	bool AddChildElemEx(LPCTSTR szName, const std::vector<float>& _v);
	bool AddChildElemEx(LPCTSTR szName, const std::vector<int>& _v);
	bool AddChildElemEx(LPCTSTR szName, const std::vector<BYTE>& _v);
	bool AddChildElemEx(LPCTSTR szName, const std::vector<short>& _v);
	bool AddChildElemEx(LPCTSTR szName, const std::vector<long>& _v);
	bool AddChildElemEx(LPCTSTR szName, const std::valarray<double>& _v );
	bool AddChildElemEx(LPCTSTR szName, const std::valarray<float>& _v );
	bool AddChildElemEx(LPCTSTR szName, const std::valarray<int>& _v );
	bool AddChildElemEx(LPCTSTR szName, const std::valarray<BYTE>& _v )	;
	bool AddChildElemEx(LPCTSTR szName, const std::valarray<short>& _v );
	bool AddChildElemEx(LPCTSTR szName, const std::valarray<long>& _v )	;
	bool AddChildElemEx(LPCTSTR szName, const std::list<UINT>& _l);
	bool AddChildElemEx(LPCTSTR szName, const std::list<double>& _l);
	bool AddChildElemEx(LPCTSTR szName, const std::list<float>& _l)	;
	bool AddChildElemEx(LPCTSTR szName, const std::list<int>& _l)	;
	bool AddChildElemEx(LPCTSTR szName, const std::list<BYTE>& _l);

	bool AddAttribEx(LPCTSTR szName, const CString &str);
	bool AddAttribEx(LPCTSTR szName, LPCTSTR szString = _T(""))	;
	bool AddAttribEx(LPCTSTR szName, bool _bool )	;
	bool AddAttribEx(LPCTSTR szName, int _int );
	bool AddAttribEx(LPCTSTR szName, UINT _UINT );
	bool AddAttribEx(LPCTSTR szName, DWORD _DWORD )	;
	bool AddAttribEx(LPCTSTR szName, long _long );
	bool AddAttribEx(LPCTSTR szName, float _float )	;
	bool AddAttribEx(LPCTSTR szName, double _double )	;
	bool AddAttribEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat = _T("%m/%d/%Y %H:%M:%S"));
	bool AddAttribEx(LPCTSTR szName, const COleDateTimeSpan& _ts);
	bool AddAttribEx(LPCTSTR szName, const std::vector<double>& _v );
	bool AddAttribEx(LPCTSTR szName, const std::vector<float>& _v )	;
	bool AddAttribEx(LPCTSTR szName, const std::vector<int>& _v )	;
	bool AddAttribEx(LPCTSTR szName, const std::vector<BYTE>& _v );
	bool AddAttribEx(LPCTSTR szName, const std::vector<short>& _v )	;
	bool AddAttribEx(LPCTSTR szName, const std::vector<long>& _v );
	bool AddAttribEx(LPCTSTR szName, const std::valarray<double>& _v );
	bool AddAttribEx(LPCTSTR szName, const std::valarray<float>& _v );
	bool AddAttribEx(LPCTSTR szName, const std::valarray<int>& _v )	;
	bool AddAttribEx(LPCTSTR szName, const std::valarray<BYTE>& _v );
	bool AddAttribEx(LPCTSTR szName, const std::list<UINT>& _l );
	bool AddAttribEx(LPCTSTR szName, const std::list<double>& _l );
	bool AddAttribEx(LPCTSTR szName, const std::list<float>& _l );
	bool AddAttribEx(LPCTSTR szName, const std::list<int>& _l )	;
	bool AddAttribEx(LPCTSTR szName, const std::list<BYTE>& _l );

	bool AddChildAttribEx(LPCTSTR szName, const CString &str)	;
	bool AddChildAttribEx(LPCTSTR szName, LPCTSTR szString = _T(""));
	bool AddChildAttribEx(LPCTSTR szName, bool _bool );
	bool AddChildAttribEx(LPCTSTR szName, int _int );
	bool AddChildAttribEx(LPCTSTR szName, UINT _UINT );
	bool AddChildAttribEx(LPCTSTR szName, DWORD _DWORD );
	bool AddChildAttribEx(LPCTSTR szName, long _long );
	bool AddChildAttribEx(LPCTSTR szName, float _float );
	bool AddChildAttribEx(LPCTSTR szName, double _double );
	bool AddChildAttribEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat = _T("%m/%d/%Y %H:%M:%S"));
	bool AddChildAttribEx(LPCTSTR szName, const COleDateTimeSpan& _ts);
	bool AddChildAttribEx(LPCTSTR szName, const std::vector<double>& _v );
	bool AddChildAttribEx(LPCTSTR szName, const std::vector<float>& _v );
	bool AddChildAttribEx(LPCTSTR szName, const std::vector<int>& _v );
	bool AddChildAttribEx(LPCTSTR szName, const std::vector<BYTE>& _v )	;
	bool AddChildAttribEx(LPCTSTR szName, const std::vector<short>& _v );
	bool AddChildAttribEx(LPCTSTR szName, const std::vector<long>& _v )	;
	bool AddChildAttribEx(LPCTSTR szName, const std::valarray<double>& _v )	;
	bool AddChildAttribEx(LPCTSTR szName, const std::valarray<float>& _v );
	bool AddChildAttribEx(LPCTSTR szName, const std::valarray<int>& _v );
	bool AddChildAttribEx(LPCTSTR szName, const std::valarray<BYTE>& _v );
	bool AddChildAttribEx(LPCTSTR szName, const std::list<UINT>& _l );
	bool AddChildAttribEx(LPCTSTR szName, const std::list<double>& _l )	;
	bool AddChildAttribEx(LPCTSTR szName, const std::list<float>& _l );
	bool AddChildAttribEx(LPCTSTR szName, const std::list<int>& _l );
	bool AddChildAttribEx(LPCTSTR szName, const std::list<BYTE>& _l );
	//@}

	//! \name Finders + getters
	//@{
	bool FindGetData(LPCTSTR szName, CString& _string);
	bool FindGetData(LPCTSTR szName, bool& _bool);
	bool FindGetData(LPCTSTR szName, int& _int);
	bool FindGetData(LPCTSTR szName, UINT& _UINT);
	bool FindGetData(LPCTSTR szName, DWORD& _DWORD);
	bool FindGetData(LPCTSTR szName, float& _float);
	bool FindGetData(LPCTSTR szName, double& _double);
	bool FindGetData(LPCTSTR szName, COleDateTime& _t);
	bool FindGetData(LPCTSTR szName, COleDateTimeSpan& _ts);
	bool FindGetData(LPCTSTR szName, std::vector<double>& _vDouble);
	bool FindGetData(LPCTSTR szName, std::vector<float>& _vFloat);
	bool FindGetData(LPCTSTR szName, std::vector<int>& _vInt);
	bool FindGetData(LPCTSTR szName, std::vector<BYTE>& _vBYTE);
	bool FindGetData(LPCTSTR szName, std::vector<short>& _vShort);
	bool FindGetData(LPCTSTR szName, std::vector<long>& _vLong);
	bool FindGetData(LPCTSTR szName, std::valarray<double>& _vDouble);
	bool FindGetData(LPCTSTR szName, std::valarray<float>& _vFloat);
	bool FindGetData(LPCTSTR szName, std::valarray<int>& _vInt);
	bool FindGetData(LPCTSTR szName, std::valarray<BYTE>& _vBYTE);
	bool FindGetData(LPCTSTR szName, std::valarray<short>& _vShort);
	bool FindGetData(LPCTSTR szName, std::valarray<long>& _vLong);
	bool FindGetData(LPCTSTR szName, std::list<UINT>& _lUINT);
	bool FindGetData(LPCTSTR szName, std::list<double>& _lDouble);
	bool FindGetData(LPCTSTR szName, std::list<float>& _lFloat);
	bool FindGetData(LPCTSTR szName, std::list<int>& _lInt);
	bool FindGetData(LPCTSTR szName, std::list<BYTE>& _lByte);

	bool FindGetChildData(LPCTSTR szName, CString& _string);
	bool FindGetChildData(LPCTSTR szName, bool& _bool);
	bool FindGetChildData(LPCTSTR szName, int& _int);
	bool FindGetChildData(LPCTSTR szName, UINT& _UINT);
	bool FindGetChildData(LPCTSTR szName, DWORD& _DWORD);
	bool FindGetChildData(LPCTSTR szName, float& _float);
	bool FindGetChildData(LPCTSTR szName, long& _long);
	bool FindGetChildData(LPCTSTR szName, double& _double);
	bool FindGetChildData(LPCTSTR szName, COleDateTime& _t);
	bool FindGetChildData(LPCTSTR szName, COleDateTimeSpan& _ts);
	bool FindGetChildData(LPCTSTR szName, std::vector<double>& _vDouble);
	bool FindGetChildData(LPCTSTR szName, std::vector<float>& _vFloat);
	bool FindGetChildData(LPCTSTR szName, std::vector<int>& _vInt);
	bool FindGetChildData(LPCTSTR szName, std::vector<BYTE>& _vBYTE);
	bool FindGetChildData(LPCTSTR szName, std::vector<short>& _vShort);
	bool FindGetChildData(LPCTSTR szName, std::vector<long>& _vLong);
	bool FindGetChildData(LPCTSTR szName, std::valarray<double>& _vDouble);
	bool FindGetChildData(LPCTSTR szName, std::valarray<float>& _vFloat);
	bool FindGetChildData(LPCTSTR szName, std::valarray<int>& _vInt);
	bool FindGetChildData(LPCTSTR szName, std::valarray<BYTE>& _vByte);
	bool FindGetChildData(LPCTSTR szName, std::valarray<short>& _vShort);
	bool FindGetChildData(LPCTSTR szName, std::valarray<long>& _vLong);
	bool FindGetChildData(LPCTSTR szName, std::list<UINT>& _lUINT);
	bool FindGetChildData(LPCTSTR szName, std::list<double>& _lDouble);
	bool FindGetChildData(LPCTSTR szName, std::list<float>& _lFloat);
	bool FindGetChildData(LPCTSTR szName, std::list<int>& _lInt);
	bool FindGetChildData(LPCTSTR szName, std::list<BYTE>& _lBYTE);
	//@}

	//! \name Base class override to handle namespace
	//@{
	virtual bool AddElem( LPCTSTR szName, LPCTSTR szData=NULL )				
	{	
		if (m_sNameSpace.IsEmpty()) 
			return CMarkup::AddElem( szName, szData); 
		else 
			return CMarkup::AddElem( m_sNameSpace+szName, szData);
	};

	virtual bool AddChildElem( LPCTSTR szName, LPCTSTR szData=NULL )		
	{	
		if (m_sNameSpace.IsEmpty()) 
			return CMarkup::AddChildElem( szName, szData); 
		else 
			return CMarkup::AddChildElem( m_sNameSpace+szName, szData);
	};

	virtual bool FindElem( LPCTSTR szName=NULL )							
	{	
		if (szName==NULL) 
			return CMarkup::FindElem( NULL); 
		else 
			if (m_sNameSpace.IsEmpty())
				return CMarkup::FindElem(szName);
			else
				return CMarkup::FindElem( m_sNameSpace+szName);
	};

	virtual bool FindChildElem( LPCTSTR szName=NULL )
	{	
		if (szName==NULL) 
			return CMarkup::FindChildElem( NULL); 
		else 
			if (m_sNameSpace.IsEmpty())
				return CMarkup::FindChildElem(szName);
			else
				return CMarkup::FindChildElem( m_sNameSpace+szName);
	};

	bool FindElemAttrib( LPCTSTR szName, LPCTSTR szAttrib, LPCTSTR szAttribValue );
	bool FindChildElemAttrib( LPCTSTR szName , LPCTSTR szAttrib, LPCTSTR szAttribValue );
	//@}

protected:
	//! \name Attributes
	//@{
	//! Falgs
	DWORD m_dwMode;
	//! encoding string
	CString m_strEncodingString;
	//! Current namespace, can be empty
	CString m_sNameSpace;
	//@}
private:
	CString m_sTemp;
};


};

#endif // !defined(AFX_PGLMARKUP_H__3BB8B027_BBD6_4DCF_ACDE_7F1922437BEB__INCLUDED_)
